package com.zjhome.service.redis.service.impl;

import java.util.concurrent.TimeUnit;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import com.zjhome.service.redis.service.RedisService;

@Service
public class RedisServiceImpl implements RedisService {
	@Autowired
	private RedisTemplate	redisTemplate;

	@Override
	public void put(String key, Object value, long seconds) {
		// TODO Auto-generated method stub
		redisTemplate.opsForValue().set(key, value, seconds, TimeUnit.SECONDS);
	}

	@Override
	public Object get(String key) {
		// TODO Auto-generated method stub
		return redisTemplate.opsForValue().get(key);
	}

}
